package com.example.a2212a_ivideo_kotlin

import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.launcher.ARouter
import com.bawei.lib_base.RoutePath
import com.bawei.lib_common.base.BaseActivity
import com.bawei.lib_common.view.CircleCountDownView
import com.bawei.module_main.MainAActivity
import com.example.a2212a_ivideo_kotlin.databinding.ActivityMainBinding
import com.example.image.glide.GlideImgLoader
import com.luck.picture.lib.utils.ToastUtils
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : BaseActivity<ActivityMainBinding>(){
    override fun getLayoutId(): Int {
        return R.layout.activity_main
    }

    override fun initViews() {
      //加载App主图
        mDataNBinding.add.run {
            GlideImgLoader.LoadResImage(this,R.drawable.aaad,this)
        }

        mDataNBinding.cdView.apply {
            setCountDownListener(object :CircleCountDownView.CountDownListener{
                override fun countDownFinished() {
                    Log.d("TAG", "countDownFinished: hahahahah倒计时")
                    ARouter.getInstance().build(RoutePath.PATH_LOGIN_PAGE).navigation()
                 // startActivity( Intent(this@MainActivity, MainAActivity::class.java))
                }
            })
            startCountDown()
        }


    }

    override fun onDestroy() {
        mDataNBinding.cdView.stopCountDown()
        super.onDestroy()
    }

}